<!DOCTYPE html>
<html>

<include file="public@head"/>
<body>
<include file="public@nav"/>
    <div data-v-8a35b7d8="" id="home" class="homepage app_main">
        <div data-v-8a35b7d8="" class="content_common">
            <center><h1><a href="/portal/index/test">清除缓存数据</a></h1></center>
            <div class="quotes g_center">
                <div class="layui-carousel" id="test1">
                    <div carousel-item>
                        <volist name="slide" id="v">
                            <div><img src="/upload/{$v.image}" width="100%" height="100%"></div>
                        </volist>
                    </div>
                </div>
                <!-- 幻灯片 -->
                <script src="/static/build/layui.js"></script>
                <script>
                    layui.use('carousel', function(){
                        var carousel = layui.carousel;
                        //建造实例
                        carousel.render({
                            elem: '#test1'
                            ,width: '100%' //设置容器宽度
                            ,arrow: 'always' //始终显示箭头
                            // ,anim: 'updown' //切换动画方式
                        });
                    });
                </script>
                <div data-v-8a35b7d8="" class="latest_news">
                    <div class="content12_common content12">
                        <ul class="main">
                            <li>
                                <div class="txt">最新消息：</div>
                            </li>
                            <li class="content">
                                <div class="content_z" style="margin-top: 0px;">
                                    <volist name="message" id="v">
                                    <div class="sroll_list j_scroll">
                                        <a href="{:cmf_url('portal/article/index',array('id'=>$v['id']))}"><span>{$v.post_title}</span></a>
                                    </div>
                                    </volist>

                                   </div>

                            </li>
                            <li><a href="{:cmf_url('portal/list/index')}" class="more">更多...</a></li>
                        </ul>
                    </div>
                </div>
                <script>
                    marqueen();
                    function marqueen() {
                        var _this = $('.content_z');
                        $('.content_z').animate({
                            marginTop: '-20px'
                        }, 500, function () {
                            _this.css('margin-top', 0).find('.sroll_list:first').appendTo(_this);
                        });
                        setTimeout(marqueen, 5000)
                    }

                </script>
                <br />
                <div>
                   <div style="width: 500px;height: 200px;background: mediumpurple;display: inline-block;margin-right: 100px" align="left">
                       <p style="color: white;font-size: large;margin-top: 50px;margin-left: 50px">鸡蛋总量：</p>
                       <p style="color: white;font-size: large;margin-top: 50px;margin-left: 50px">鸡蛋总量：</p>

                   </div>
                    <div style="width: 500px;height: 200px;background: deepskyblue;display: inline-block" align="left">
                        <p style="color: white;font-size: large;margin-top: 50px;margin-left: 50px">今日交易总量：</p>
                        <p style="color: white;font-size: large;margin-top: 50px;margin-left: 50px">今日交易总额：</p>
                </div>
                </div>
                <br />
                <div data-v-66913358="" class="header">
                    <div class="title">行情信息</div>
                </div>
                <center>
                    <div class="btn-group" data-toggle="buttons" id="kline" style="width: 1200px">
                        <a class="btn btn-primary focus" id="m1"  onclick="k_line(1)">1分钟线</a>
                        <a class="btn btn-primary" id="m5"  onclick="k_line(5)">5分钟线</a>
                        <a class="btn btn-primary" id="m15"  onclick="k_line(15)">15分钟线</a>
                        <a class="btn btn-primary" id="m30"  onclick="k_line(30)">30分钟线</a>
                        <a class="btn btn-primary" id="m60"  onclick="k_line(60)">1小时线</a>
                    </div>
                </center>
                <div id="main" style="width: 1200px;height:400px;"></div>

                <script type="text/javascript">
                    var myChart = echarts.init(document.getElementById('main'));
                    myChart.title = '2018年 牛币指数';
                    myChart.showLoading();    //数据加载完之前先显示一段简单的loading动画

                    k_line(1); // 默认显示1分钟K线图

                    $('.btn').click(function () {
                       $(this).addClass('focus');
                        $(this).siblings().removeClass('focus');
                    });
                    // 点击时显示不同时间K线

                    setInterval(function () {
                        $('.focus').trigger("click");
                    },60000);
                    // 设置K线刷新时间

                    function k_line(kind){

                        $.ajax({
                            type : "post",
                            async : true,            //异步请求（同步请求将会锁住浏览器，用户其他操作必须等待请求完成才可以执行）
                            url : "/portal/index/kline",    //请求发送到TestServlet处
                            data : {'kind':kind},
                            dataType : "json",        //返回数据形式为json
                            success : function(result) {
                                //请求成功时执行该函数内容，result即为服务器返回的json对象
                                if (result) {
                                    rawData = result;
                                    function calculateMA(dayCount, data) {
                                        var result = [];
                                        for (var i = 0, len = data.length; i < len; i++) {
                                            if (i < dayCount) {
                                                result.push('-');
                                                continue;
                                            }
                                            var sum = 0;
                                            for (var j = 0; j < dayCount; j++) {
                                                sum += data[i - j][1];
                                            }
                                            result.push(sum / dayCount);
                                        }
                                        return result;
                                    }

                                    var dates = rawData.map(function (item) {
                                        return item[0];
                                    });

                                    var data = rawData.map(function (item) {
                                        return [+item[1], +item[2], +item[5], +item[6]];
                                    });

                                    myChart.hideLoading();    //隐藏加载动画

                                    myChart.setOption({
                                        backgroundColor: '#21202D',
                                        legend: {
                                            data: ['K线', 'MA5', 'MA10', 'MA20', 'MA30'],
                                            inactiveColor: '#777',
                                            textStyle: {
                                                color: '#fff'
                                            }
                                        },
                                        tooltip: {
                                            trigger: 'axis',
                                            axisPointer: {
                                                animation: false,
                                                type: 'cross',
                                                lineStyle: {
                                                    color: '#376df4',
                                                    width: 2,
                                                    opacity: 1
                                                }
                                            }
                                        },
                                        xAxis: {
                                            type: 'category',
                                            data: dates,
                                            axisLine: { lineStyle: { color: '#8392A5' } }
                                        },
                                        yAxis: {
                                            scale: true,
                                            axisLine: { lineStyle: { color: '#8392A5' } },
                                            splitLine: { show: false }
                                        },
                                        grid: {
                                            bottom: 80
                                        },
                                        dataZoom: [{
                                            textStyle: {
                                                color: '#8392A5'
                                            },
                                            handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
                                            handleSize: '80%',
                                            dataBackground: {
                                                areaStyle: {
                                                    color: '#8392A5'
                                                },
                                                lineStyle: {
                                                    opacity: 0.8,
                                                    color: '#8392A5'
                                                }
                                            },
                                            handleStyle: {
                                                color: '#fff',
                                                shadowBlur: 3,
                                                shadowColor: 'rgba(0, 0, 0, 0.6)',
                                                shadowOffsetX: 2,
                                                shadowOffsetY: 2
                                            }
                                        }, {
                                            type: 'inside'
                                        }],
                                        animation: false,
                                        series: [
                                            {
                                                type: 'candlestick',
                                                name: 'K线',
                                                data: data,
                                                itemStyle: {
                                                    normal: {
                                                        color: '#FD1050',
                                                        color0: '#0CF49B',
                                                        borderColor: '#FD1050',
                                                        borderColor0: '#0CF49B'
                                                    }
                                                }
                                            },
                                            {
                                                name: 'MA5',
                                                type: 'line',
                                                data: calculateMA(5, data),
                                                smooth: true,
                                                showSymbol: false,
                                                lineStyle: {
                                                    normal: {
                                                        width: 1
                                                    }
                                                }
                                            },
                                            {
                                                name: 'MA10',
                                                type: 'line',
                                                data: calculateMA(10, data),
                                                smooth: true,
                                                showSymbol: false,
                                                lineStyle: {
                                                    normal: {
                                                        width: 1
                                                    }
                                                }
                                            },
                                            {
                                                name: 'MA20',
                                                type: 'line',
                                                data: calculateMA(20, data),
                                                smooth: true,
                                                showSymbol: false,
                                                lineStyle: {
                                                    normal: {
                                                        width: 1
                                                    }
                                                }
                                            },
                                            {
                                                name: 'MA30',
                                                type: 'line',
                                                data: calculateMA(30, data),
                                                smooth: true,
                                                showSymbol: false,
                                                lineStyle: {
                                                    normal: {
                                                        width: 1
                                                    }
                                                }
                                            }
                                        ]
                                    });
                                }

                            },
                            error : function(errorMsg) {
                                //请求失败时执行该函数
                                // alert(errorMsg);
                                console.log(errorMsg);
                                myChart.hideLoading();
                            }
                        });

                    }

                </script>

                <ul data-v-66913358="" class="table_list list_head">
                    <li data-v-66913358="">交易对</li>
                    <li data-v-66913358="">最新成交价</li>
                    <li data-v-66913358="">涨幅</li>
                    <li data-v-66913358="">买一价/卖一价</li>
                    <li data-v-66913358="">24小时成交量</li>
                </ul>
                <div id="price_ul">
                    <ul data-v-66913358="" class="table_list list_body">
                        <li data-v-66913358="">RFC(RFC/DOGE)</li>
                        <li data-v-66913358="">￥ 0.14</li>
                        <li data-v-66913358="" class="increase_dwon"><span data-v-66913358="" class="change_txt">-6.66 %</span>
                        </li>
                        <li data-v-66913358="">￥0.14/￥0.15</li>
                        <li data-v-66913358="" class="link_icon">
                            <span data-v-66913358="" class="vol_txt">1.33万</span></li>
                        <li data-v-66913358="" class="link_box"><a data-v-66913358="" href="http://www.uyulin.com/trade/index/market/rfc_doge"></a></li>
                    </ul>
                    <ul data-v-66913358="" class="table_list list_body">
                        <li data-v-66913358="">LTC(LTC/DOGE)</li>
                        <li data-v-66913358="">￥ 1800.00</li>
                        <li data-v-66913358="" class="increase_up"><span data-v-66913358="" class="change_txt">10.76 %</span></li>
                        <li data-v-66913358="">￥1760.00/￥1848.00</li>
                        <li data-v-66913358="" class="link_icon"><span data-v-66913358="" class="vol_txt">7.97</span></li>
                        <li data-v-66913358="" class="link_box"><a data-v-66913358="" href="http://www.uyulin.com/trade/index/market/ltc_doge"></a></li>
                    </ul>
                    <ul data-v-66913358="" class="table_list list_body">
                        <li data-v-66913358="">LLT(LLT/DOGE)</li>
                        <li data-v-66913358="">￥ 1.77</li>
                        <li data-v-66913358="" class="increase_dwon"><span data-v-66913358="" class="change_txt">-1.11 %</span></li>
                        <li data-v-66913358="">￥1.70/￥1.80</li>
                        <li data-v-66913358="" class="link_icon"><span data-v-66913358="" class="vol_txt">5140.86</span></li>
                        <li data-v-66913358="" class="link_box"><a data-v-66913358="" href="http://www.uyulin.com/trade/index/market/llt_doge"></a></li>
                    </ul>
                    <ul data-v-66913358="" class="table_list list_body">
                        <li data-v-66913358="">EGG(EGG/DOGE)</li>
                        <li data-v-66913358="">￥ 4.57</li>
                        <li data-v-66913358="" class="increase_dwon"><span data-v-66913358="" class="change_txt">-5.77 %</span></li>
                        <li data-v-66913358="">￥4.55/￥4.59</li>
                        <li data-v-66913358="" class="link_icon"><span data-v-66913358="" class="vol_txt">13.84万</span></li>
                        <li data-v-66913358="" class="link_box"><a data-v-66913358="" href="http://www.uyulin.com/trade/index/market/egg_doge"></a></li>
                    </ul>
                </div>

                <div data-v-66913358="" class="more_area"><a href="http://www.uyulin.com/trade/index.html">去交易中心</a>
                </div>
            </div>
        <br />
        </div>

        <div data-v-8a35b7d8="" class="characteristic_common homepage_characteristic">
            <div class="main">

                <div class="title"><h1>最新公告</h1></div><div style="float: right;"><a href="{:cmf_url('portal/list/index',array('id'=>2))}">查看更多 >></a></div>
                <div class="characteristic_cont">

                    <volist name="notice" id="v">
                    <div class="char_group">
                        <a href="{:cmf_url('portal/Article/index',array('id'=>$v.id,'cid'=>$v.category_id))}">
                        <div class="content-limit"><center><h3 class="content-limit">{$v.post_title}</h3></center></div>
                        <img src="/upload/{$v.more.thumbnail}" width="100px" height="100px">
                        <div class="char_txt content-excerpt">{$v.post_excerpt|htmlspecialchars_decode}</div></a>
                    </div>
                    </volist>

                </div>
            </div>
        </div>

        <div data-v-8a35b7d8="" class="characteristic_common homepage_characteristic">
            <div class="main">
                <div class="title"><h1>学堂</h1></div><div style="float: right;"><a href="{:cmf_url('portal/list/index',array('id'=>3))}">查看更多 >></a></div>
                <div class="characteristic_cont">

                    <volist name="study" id="v">
                        <div class="char_group">
                            <a href="{:cmf_url('portal/Article/index',array('id'=>$v.id,'cid'=>$v.category_id))}">
                                <div class="content-limit"><center><h3 class="content-limit">{$v.post_excerpt}</h3></center></div>
                                <img src="/upload/{$v.more.thumbnail}" width="100px" height="100px">
                                <div class="char_txt content-excerpt">{$v.post_excerpt|htmlspecialchars_decode}</div></a>
                        </div>
                    </volist>

                </div>
            </div>
        </div>
        <div data-v-8a35b7d8="" class="characteristic_common homepage_characteristic">
            <div class="main">
                <div class="title"><h1>咨询</h1></div><div style="float: right;"><a href="{:cmf_url('portal/list/index',array('id'=>4))}">查看更多 >></a></div>
                <div class="characteristic_cont">

                    <volist name="application" id="v">
                        <div class="char_group">
                            <a href="{:cmf_url('portal/Article/index',array('id'=>$v.id,'cid'=>$v.category_id))}">
                                <div class="content-limit"><center><h3 class="content-limit">{$v.post_excerpt}</h3></center></div>
                                <img src="/upload/{$v.more.thumbnail}" width="100px" height="100px">
                                <div class="char_txt content-excerpt">{$v.post_excerpt|htmlspecialchars_decode}</div></a>
                        </div>
                    </volist>

                </div>
            </div>
        </div>
        <include file="public@footer"/>
    </div>

</body></html>